#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void buddle_sort(int arr[], int sz) {
	int i = 0;
	for (i = 0; i < sz - 1; i++) {
		int j = 0;
		for (j = 0; j < sz - 1 - i; j++) {
			if (arr[j] > arr[j + 1]) {
				int tmp = 0;
				tmp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = tmp;
			}
		}
	}
}

int main() {
	int arr[] = { 0, 9, 8, 6, 4, 7, 5, 2, 1, 3 };
	int sz = sizeof(arr) / sizeof(arr[0]);

	buddle_sort(arr, sz);

	int i = 0;
	for (i = 0; i < sz; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}